#include<stdio.h>
#include<math.h>

int main()
{
	double n;
	scanf("%lf",&n);
	if(n>=0) printf("%.2lf",sqrt(n));
	else printf("%.2lf",pow(n+1,2)+2*n+1/n);
	return 0;
}
